import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/page/Home'
import HotelList from '@/page/Hotel/HotelList'
import HotePage from '@/page/Hotel/HotePage'
import SceneryList from '@/page/Scenery/SceneryList'
import SceneryPage from '@/page/Scenery/SceneryPage'
import StrategyList from '@/page/Strategy/StrategyList'
import StrategyPage from '@/page/Strategy/StrategyPage'
import User from '@/page/User/User'
Vue.use(Router)
/**
 * 重写路由的push方法
 */
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error=> error)
}
export default new Router({
  mode: 'history',
  routes: [{
    path: '/',
    name: 'Home',
    component: Home
  }, {
    path: '/hotel',
    name: 'HotelList',
    component: HotelList
  },{
    path: '/hote/page',
    name: 'HotePage',
    component: HotePage
  },{
    path: '/scenery',
    name: 'SceneryList',
    component: SceneryList
  },{
    path: '/scenery/Page',
    name: 'SceneryPage',
    component: SceneryPage
  },{
    path: '/strategy',
    name: 'StrategyList',
    component: StrategyList
  },{
    path: '/Strategy/Page',
    name: 'StrategyPage',
    component: StrategyPage
  },{
    path: '/User',
    name: 'User',
    component: User
  }

]
})
